package uilayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MainMenuGUI extends JFrame {

	private JPanel contentPane;
	private VareGUI vGUI;
	//private PersonGUI pGUI;
	//private OrdreGUI oGUI;
	private LoginMenu lMenu;
	private static MainMenuGUI frame;


	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame = new MainMenuGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainMenuGUI() {
		setTitle("Main menu");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 663, 407);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JButton btnNewButton = new JButton("Personer");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				//pGUI.main(null);
			}
		});
		btnNewButton.setBounds(51, 66, 146, 75);
		contentPane.add(btnNewButton);

		JButton btnVarer = new JButton("Varer");
		btnVarer.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.setVisible(false);
				vGUI.main(null);					
			}
		});
		btnVarer.setBounds(240, 66, 146, 75);
		contentPane.add(btnVarer);

		JButton btnOrdre = new JButton("Ordre");
		btnOrdre.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				//oGUI.main(null);
			}
		});
		btnOrdre.setBounds(429, 66, 146, 75);
		contentPane.add(btnOrdre);

		JButton btnLogUd = new JButton("Log ud");
		btnLogUd.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				lMenu.main(null);
			}
		});
		btnLogUd.setBounds(51, 176, 146, 75);
		contentPane.add(btnLogUd);

		JButton btnExplode = new JButton("EXPLODE");
		btnExplode.setToolTipText("DO NOT CLICK!!!!");
		btnExplode.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.dispose();
			}
		});
		btnExplode.setForeground(Color.RED);
		btnExplode.setBackground(Color.RED);
		btnExplode.setBounds(429, 176, 146, 75);
		contentPane.add(btnExplode);
	}
}
